home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / mgrdemos.zoo / demo / sh / square < prev    next >
Encoding:
Text File  |  1989-01-25  |  973 b   |  37 lines

  1. #!/bin/sh
  2. #                        Copyright (c) 1987 Bellcore
  3. #                            All Rights Reserved
  4. #       Permission is granted to copy or use this program, EXCEPT that it
  5. #       may not be sold for profit, the copyright notice must be reproduced
  6. #       on copies, and credit should be given to Bellcore where it is due.
  7. #       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  8.  
  9. #    $Header: square,v 4.1 88/06/21 14:01:40 bianchi Exp $
  10. #    $Source: /tmp/mgrsrc/demo/sh/RCS/square,v $
  11.  
  12. # square a window 
  13.  
  14. ESC=""
  15. SHAPE="W"
  16. SIZE="4I"
  17.  
  18. if /bin/test $TERM != mgr
  19. then
  20.    echo "$0 only works on mgr terminals"
  21.    exit 1
  22. fi
  23.  
  24. #    get current size
  25.  
  26. stty -echo
  27. echo -n "${ESC}${SIZE}"
  28. read x y wide high
  29. stty echo
  30. case $# in
  31.    0) echo -n "${ESC}$x,$y,$wide,$wide$SHAPE" ;;
  32.    1) echo -n "${ESC}$x,$y,$1,$1$SHAPE" ;;
  33.    2) high=`expr $1 '*' $2 / 100`
  34.       echo -n "${ESC}$x,$y,$1,$high$SHAPE" ;;
  35.    *) echo "usage: $0 [size] [aspect ratio]";;
  36. esac
  37.